package com.meng.logback.controller;

import com.alibaba.fastjson.JSON;
import com.meng.logback.model.Student;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @author xinqimeng
 * @version 1.0.0
 * @ClassName controller.java
 * @Description TODO
 * @createTime 2022年10月28日 16:44:00
 */
@Slf4j
@RestController
@RequestMapping("/testlogback")
public class TestInfoController {

    @GetMapping("/infoLogback")
    public String info() {
        log.info("localPhone:{}, localPhone:{}","17791715067", "123456");
        //规范语法 - 推荐使用=分割
        log.info("your email:{}, your phone:{}","xinqimeng@qq.com","17791713067");
        log.info("your email={}, your myPhone={}","xinqiContextSelectorStaticBindermeng@qq.com","17791713067");
        log.info("your email={}, your phone:{}","xinqimeng@qq.com","17791713067");
        log.info("email:{}","12442343@qq.com");
        //Map类型
        Map<String,String> map = new HashMap<>();
        map.put("phone","17791717135");
        map.put("email","4324234235@qq.com");
        log.info("map={}",map);
        log.info("json map ={}", JSON.toJSONString(map));
        //对象类型
        log.info("Student:{}",new Student("张三","17712122424","6102456333266733133"));
        //对于需要完全密文的
        log.info("password:{}","53464575464");
        //非规范但也能用   --不推荐
        log.info("your mobile : {} . phone:    {}", 123123213,"17791713067");
        log.info("your mobile : {} , phone:{}", 123123213,"17791713067");
        log.info("your mobile : {} :  phone:{}", 123123213,"17791713067");


        return "xinqimeng";
    }

}
